Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Sep 18, 2025

Link: llvm/llvm-project#159583
Requested by: @artagnon

@github-actions github-actions bot mentioned this pull request Sep 18, 2025
@zyw-bot
Copy link
Collaborator Author

zyw-bot commented Sep 18, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@d62505f
patch: llvm/llvm-project#159583
sha256: 62e30e2be0fb73d1af8dafb0db36a773ac7c99c301200e36730d8d114fc07bbf
commit: c3bd5c2

2386 files changed, 2978068 insertions(+), 2946009 deletions(-)

Improvements:
  simplifycfg.NumFoldBranchToCommonDest 772694 -> 784888 +1.58%
  indvars.NumElimCmp 57291 -> 57703 +0.72%
  licm.NumLoadStorePromoted 72269 -> 72756 +0.67%
  jump-threading.NumFolds 2649095 -> 2661337 +0.46%
  loop-delete.NumDeleted 115672 -> 116029 +0.31%
  loop-instsimplify.NumSimplified 188191 -> 188463 +0.14%
  loop-rotate.NumInstrsDuplicated 3110950 -> 3114784 +0.12%
  gvn.NumGVNSimpl 4583157 -> 4587461 +0.09%
  simplifycfg.NumSinkCommonCode 374688 -> 374983 +0.08%
  gvn.IsValueFullyAvailableInBlockNumSpeculationsMax 605616 -> 606009 +0.06%
Regressions:
  simple-loop-unswitch.NumSwitches 1968 -> 1873 -4.83%
  simplifycfg.NumFoldValueComparisonIntoPredecessors 522721 -> 505006 -3.39%
  adce.NumBranchesRemoved 23740 -> 23498 -1.02%
  loop-delete.NumBackedgesBroken 45366 -> 44954 -0.91%
  licm.NumPromotionCandidates 611777 -> 607455 -0.71%
  adce.NumRemoved 98698 -> 98373 -0.33%
  memdep.NumCacheDirtyNonLocalPtr 23851 -> 23777 -0.31%
  gvn.NumGVNBlocks 197697 -> 197232 -0.24%
  local.NumPHICSEs 198759 -> 198360 -0.20%
  gvn.NumGVNInstr 155515 -> 155237 -0.18%

+16 lean4/Weekday.ll
+13 z3/add_bounds_tactic.ll
+11 verilator/V3Branch.ll
+8 wolfssl/ssl.ll
+6 abc/fxuUpdate.ll
+4 abc/cbaNtk.ll
+4 abc/fxuSingle.ll
+4 abc/giaMini.ll
+4 abc/pdrIncr.ll
+4 cpython/_posixsubprocess.ll
+4 eastl/TestHash.ll
+4 lean4/Constraint.ll
+4 lean4/WHNF.ll
+4 libquic/heap_profiler_allocation_context_tracker.ll
+4 z3/elim_unconstrained.ll
+4 z3/macro_finder_tactic.ll
+3 boost/bind_stdin_stdout.ll
+3 eastl/TestFixedHash.ll
+3 hermes/Path.ll
+3 verilator/V3Clock.ll
+2 abc/fraMan.ll
+2 cpython/readline.ll
+2 duckdb/tcache.ll
+2 git/mv.ll
+2 hermes/GCBase.ll
+2 lean4/FunInd.ll
+2 openmpi/stacktrace.ll
+2 php/element.ll
+2 wireshark/packet-tls-utils.ll
+2 zed-rs/0fzu5iswc3qhp95jt69713e0a.ll
+1 casadi/feasiblesqpmethod.ll
+1 csmith/FactUnion.ll
+1 eastl/TestIntrusiveHash.ll
+1 folly/EpollBackend.ll
+1 open3d/VoxelGrid.ll
+1 openjdk/classLoader.ll
+1 openssl/ssl_lib.ll
+1 php/zend_signal.ll
+1 qemu/libvhost-user.ll
+1 typst-rs/3kgmqnxcsl3z3n0n.ll
+1 verilator/V3Common.ll
+1 wireshark/drange.ll
+1 wireshark/proto.ll
+1 zed-rs/bqkhvme8kwgfmpydn1hdkle55.ll
+1 zed-rs/etkkpijil810uxaq6a1xhpkj9.ll
+0 assimp/ASEParser.ll
+0 boost/async.ll
+0 box2d/TaskScheduler.ll
+0 clamav/optparser.ll
+0 coreutils-rs/2oz1n2pr10bv8jmi.ll
+0 crow/example.ll
+0 curl/cf-h1-proxy.ll
+0 icu/tznames_impl.ll
+0 opencv/perf_layer.ll
+0 yosys/yosys.ll
-1 cpython/_cursesmodule.ll
-1 darktable/tags.ll
-1 ffmpeg/xcbgrab.ll
-1 hermes/CodeMotion.ll
-1 hermes/InstSimplify.ll
-1 libsodium/utils.ll
-1 openjdk/method.ll
-1 openjdk/mutableNUMASpace.ll
-1 openjdk/threads.ll
-1 redis/pages.ll
-1 typst-rs/2i78fvbm4wocuesi.ll
-1 velox/MmapAllocator.ll
-1 zed-rs/etmluiftgqx5jpyivviyferrj.ll
-2 actix-rs/3sxbtmgc7txd1oqx.ll
-2 foundations-rs/7zdc97sa0ogd517y2re7ok0yw.ll
-2 influxdb-rs/55ksfxb2g8gj9lwh.ll
-2 lean4/TextSync.ll
-2 libquic/shared_memory_posix.ll
-2 lvgl/lv_fs.ll
-2 php/zend_inference.ll
-2 php/zend_shared_alloc.ll
-2 portaudio/pa_unix_util.ll
-2 ruby/thread.ll
-2 zed-rs/3xkvahxsem1hdyf3ef4aq8akj.ll
-3 graphviz/gvplugin.ll
-3 wireshark/addr_resolv.ll
-3 zed-rs/dmgo8iibk9y4hcmil8p9yl5yt.ll
-4 cpython/obmalloc.ll
-4 html5ever-rs/2p0p1zz6gwjy9c4w.ll
-5 nanobind/nb_func.ll
-6 php/zend_hash.ll
-9 node/libnode.node_large_page.ll
-10 cpython/signalmodule.ll
-12 duckdb/pages.ll
-12 freetype/ftbase.ll
-13 jemalloc/pages.ll
-14 openjdk/objectMonitor.ll
-33 mold/gdb-index.cc.X86_64.ll
-49 openssl/err.ll

@github-actions
Copy link
Contributor

The provided diff shows a series of changes across multiple LLVM IR files, primarily involving transformations of pointer comparison and branching logic. Below is a summary of up to five major changes observed in the patch:

  1. Replacement of ptrtoint + switch with icmp + br patterns:
    Multiple instances replace sequences that convert a pointer to an integer (ptrtoint) followed by a switch on magic values (e.g., 0, -1, 1, 2) with direct pointer comparisons using icmp eq/ne ptr and conditional branches (br i1). This improves type safety and avoids potential issues with pointer-to-integer conversions.

  2. Refinement of null and sentinel pointer checks:
    Several functions previously used unsigned less-than comparisons (icmp ult ptr %ptr, inttoptr 2) to detect null or special sentinel pointers. These have been replaced with explicit equality checks against null and specific sentinels (e.g., inttoptr (i64 1 to ptr)), often combined with and/or conditions for clarity and correctness.

  3. Introduction of combined condition checks using and/or of boolean expressions:
    Instead of chaining multiple basic blocks for individual pointer checks, the updated code combines conditions using and or or of icmp results. For example, checking both null and -1 is now done via %or.cond = or i1 %is_null, %is_minus_one, streamlining control flow.

  4. Phi node predecessor list updates due to control flow restructuring:
    As branching logic is restructured (e.g., merging paths or changing successor blocks), phi nodes are updated to reflect new control flow predecessors. This includes reordering or adding/removing entries in phi instructions to maintain SSA form correctness.

  5. Improved handling of tagged or sentinel pointers in data structures:
    In several benchmarks (e.g., Lean4, Eastl, Folly), the changes reflect better optimization around tagged pointers (common in functional or high-performance C++ code), replacing fragile arithmetic-based checks with safe pointer comparisons, which may enable further optimizations or improve debuggability.

These changes collectively suggest a refactoring aimed at improving code safety, clarity, and potentially enabling further optimization by avoiding lossy ptrtoint operations and expressing intent more directly through typed comparisons.

model: qwen-plus-latest
CompletionUsage(completion_tokens=498, prompt_tokens=100943, total_tokens=101441, completion_tokens_details=None, prompt_tokens_details=None)

@artagnon
Copy link

/close

@github-actions github-actions bot closed this Sep 18, 2025
@dtcxzyw dtcxzyw deleted the test-run17832068242 branch September 19, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants